Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output filepath (#161) #162

Closed
wants to merge 1 commit into from
Closed

Conversation

varac
Copy link

@varac varac commented Dec 2, 2020

No description provided.

@varac
Copy link
Author

varac commented Dec 2, 2020

This is an example of the output changed by this PR:

❯ pre-commit run --all-files                          
Check for merge conflicts................................................Passed
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check Yaml...............................................................Passed
Check for added large files..............................................Passed
Terraform fmt............................................................Passed
Terraform validate.......................................................Passed
Terraform docs...........................................................Passed
Terraform validate with tfsec............................................Passed
Checkov..................................................................Passed
Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 3

Running tflint in cluster/default
Running tflint in environments/cloud/dev
Running tflint in environments/cloud/varac
1 issue(s) found:

Warning: Module should include an empty outputs.tf file (terraform_standard_module_structure)

  on outputs.tf line 1:
   (source code not available)

Reference: https://github.com/terraform-linters/tflint/blob/v0.21.0/docs/rules/terraform_standard_module_structure.md

Running tflint in cluster/default
Running tflint in modules/infrastructure/cce
Running tflint in modules/infrastructure/ssh
Running tflint in modules/infrastructure/vpc
Running tflint in cluster/default
Running tflint in environments/cloud/varac
1 issue(s) found:

Warning: Module should include an empty outputs.tf file (terraform_standard_module_structure)

  on outputs.tf line 1:
   (source code not available)

Reference: https://github.com/terraform-linters/tflint/blob/v0.21.0/docs/rules/terraform_standard_module_structure.md

Running tflint in environments/cloud/dev
Running tflint in modules/infrastructure/ssh
Running tflint in modules/infrastructure/vpc

@varac
Copy link
Author

varac commented Dec 4, 2020

In the above output you see that tflint runs multiple times in the same directory, is this expected ?

@1oglop1
Copy link

1oglop1 commented Dec 15, 2020

In the above output you see that tflint runs multiple times in the same directory, is this expected ?

@varac Hi, really like this feature.

Maybe if you included tree or repo you tried it on would help.

@varac
Copy link
Author

varac commented Dec 15, 2020

Maybe if you included tree or repo you tried it on would help.

It's a private repo so I don't like to disclose it publicly. I think you are referring to the fact that that tflint runs multiple times in the same directory ? I'll better open a dedicated issue for this. This PR is just for printing the path tflint is working on.

@1oglop1
Copy link

1oglop1 commented Dec 22, 2020

Maybe if you included tree or repo you tried it on would help.

It's a private repo so I don't like to disclose it publicly. I think you are referring to the fact that that tflint runs multiple times in the same directory ? I'll better open a dedicated issue for this. This PR is just for printing the path tflint is working on.

In that case I think that makes sense.
Also creating some dummy repository to prove it would be helpful imo

@varac
Copy link
Author

varac commented Jan 18, 2021

@antonbabenko ping, what do you think about this PR ?

@1oglop1
Copy link

1oglop1 commented Feb 11, 2021

@Vlaaaaaaad I noticed you liked my PR, and since @antonbabenko takes preference on issues/PRs from sponsors it may help if you participate in the discussion to give @antonbabenko incentive to look at this 1 line change

@kpankonen
Copy link

In the above output you see that tflint runs multiple times in the same directory, is this expected ?

if multiple files in a single directory are changed (or pre-commit run --all-files is run), it's possible that files from one directory will end up split across pre-commit processes. that will cause this hook to run multiple times in a single directory

pre-commit provides the require_serial option which helps but is also slower

@MaxymVlasov MaxymVlasov added estimate/1h Need 1 hour to be done hook/terraform_tflint Bash hook feature New feature or request labels Sep 3, 2021
@antonbabenko antonbabenko added this to the Bug and docs fixes milestone Sep 10, 2021
@MaxymVlasov MaxymVlasov self-requested a review September 30, 2021 12:44
Copy link
Collaborator

@MaxymVlasov MaxymVlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

When test PR, I found that dirs will print always, not only when TFLint found errors.

Found working solution, but no chance to integrate it to this PR, so I open #234 that do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimate/1h Need 1 hour to be done feature New feature or request hook/terraform_tflint Bash hook
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants